#!/bin/bash

read -p "confirm starship tar file exists"

if [ ! -e ~/starship-x86_64-unknown-linux-musl.tar.gz ]; then
    echo "starship doesn't exist, exit."
    exit
fi

cd ~
tar -zxvf starship-x86_64-unknown-linux-musl.tar.gz
cp starship /usr/local/bin/
chown root:root /usr/local/bin/starship
chmod 755 /usr/local/bin/starship

echo "eval \"\$(starship init bash)\"" >>~/.bashrc

rm starship
rm -r starship*
